import User from '../food/User.vue'
import Book from '../food/Book.vue'
import Borr from '../food/Borr.vue'
import Reminders from '../food/Reminders.vue'
import System from '../food/System.vue'
import { createRouter, createWebHashHistory } from "vue-router";
const router=createRouter({
    history:createWebHashHistory(),
    routes:[
        {path:'/',redirect:'/index',meta:{title:'首页'},name:'index'},
        {path:'/User',component:User,meta:{title:'用户管理'}},
        {path:'/Book',component:Book,meta:{title:'图书管理'}},
        {path:'/Borr',component:Borr,meta:{title:' 借阅管理'}},
        {path:'/Reminders',component:Reminders,meta:{title:'催还提醒'}},
        {path:'/System',component:System,meta:{title:'系统管理'}},
    ]
})
router.beforeEach((to,from,next)=>{
    document.title=to.meta.title
    next()
})
export default router